<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品导航</title>
    <script src="../utils/flexible.js"></script>
    <link rel="stylesheet" href="../css/sitenav.css">
</head>

<body>
    <header id="header">
        <a href="index.html" class="back fl">〈</a>
        <h4>商品导航</h4>
        <div class="app fr">
            <a href="">
                <img src="../images/header_app.png" alt="">
            </a>
        </div>
    </header>
    <!-- main -->
    <main>
        <ul class="uu clearfix">

        </ul>
    </main>
    <!--底部-->
    <section id="footer">
        <div class="chart clearfix">
            <span class="chart_in fl">品牌排行</span>
            <span class="more fr">
            </span>
        </div>
        <div class="login">
            <div class="container">
                <div class="row">
                    <a href="">
                        <div class="col-xs-3">登入</div>
                    </a>
                    <a href="">
                        <div class="col-xs-4">注册</div>
                    </a>
                    <a href="">
                        <div class="col-xs-5">返回顶部</div>
                    </a>
                    <span></span>
                </div>
            </div>
            <div class="content_b">
                <p>
                    <a href="#">
                        手机APP下载
                    </a>
                    <a href="#">
                        万锋智慧商城手机版
                    </a> -- 掌上比价平台
                </p>
                <p>
                    chst.vip:8081/crm </p>
            </div>
        </div>
    </section>
</body>

</html>
<script src='https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js'></script>
<script>
    let uu = document.querySelector('.uu')

    fetch("http://chst.vip:1234/api/getsitenav")
        .then(body => body.json())
        .then(res => {
            render(res.result, uu)
        })

    function render(data, el) {
        data.forEach(item => {
            let li = document.createElement('li');
            let result = item.navImg
            let domStr = `
            <img width="16" src="${result}" alt="">
            <span>${item.navTitle}</span>
             `
            li.innerHTML = domStr;
            el.appendChild(li)
        })

    }
</script>